import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;

public class WriteFile extends Thread {
    File file;
    int block;
    int L=100;
    public WriteFile(File f,int b){
        this.file = f;
        this.block = b;
    }

    @Override
    public void run() {
        try {
            RandomAccessFile raf = new RandomAccessFile(file,"rw");
            try {
                raf.seek((block-1)*L);
                raf.writeBytes("hahah");
            } catch (IOException e) {
                e.printStackTrace();
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
}
